﻿Option Explicit On
Option Strict On

Imports System.Windows.Forms

Public Class CurrencyTextBox
    Public Shared Function CurrencyOnly(ByVal TargetTextBox As TextBox, ByVal CurrentChar As Char) As Boolean
        If IsNumeric(CurrentChar) = True Then
            Return False
        End If

        If CBool(((Convert.ToString(CurrentChar) = "." AndAlso CBool(InStr(TargetTextBox.Text, "."))))) Then
            Return True
        End If

        If Convert.ToString(CurrentChar) = "." OrElse CurrentChar = vbBack Then
            Return False
        End If

        Return True
    End Function
End Class